//移除元素 力扣27
//快慢指针 slow占位 fast判断 
class Solution {
public:
	int removeElement(vector<int>& nums, int val) {
		int n = nums.size();
		int fast = 0;
		int slow = 0;
		while(n--)
		{
			if(nums[fast] != val) 
			{
				nums[slow] = nums[fast];
				fast++;
				slow++;
			}
			else
			{
				fast++;
			}
			
			
		}
		return slow;
	}
};
